﻿using System;

public partial class StateManagement_ViewState1 : System.Web.UI.Page
{
    private int k = 10;
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnShow_Click(object sender, EventArgs e)
    {
        if (ViewState["myValue"] != null)
            k = Int32.Parse(ViewState["myValue"].ToString());
        k = k + 5;
        Response.Write("Value = " + k);
        ViewState["myValue"] = k;
        //ViewState.Add("myValue", k);
    }
}
